<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue初体验</title>
    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>

<body>

    <div id="app">
        <!-- 事件 -->
        <button @click="sayHi">讨厌</button>

        <button v-for="(gf,i) in gfList" :key="i" v-text="gf" @click="sayHi3($event,gf)"></button>
    </div>

    <!-- 1.导入 vue框架 -->
    <script src="./vue.js"></script>
    <!-- 2.编写 js代码 -->
    <script>
        // 3.创建 vue 实例
        let vm = new Vue({
            el: '#app',
            data: {
            },
            methods: {
                sayHi(e) {
                    console.log('讨厌', e)
                },
                sayHi3(e, gfName) {
                    console.log(e)
                    console.log(gfName)
                }
            }
        })
        // 测试：直接从 es全局作用域中 打印 vue实例
        console.log(vm)
    </script>
</body>

</html>